1. Field of the Invention
The present invention relates generally to data processing environments and, more particularly, to allocation and management of unique identifiers, especially in distributed database environments.
2. Description of the Background Art
Computers are very powerful tools for storing and providing access to vast amounts of information. Computer databases are a common mechanism for storing information on computer systems while providing easy access to users. A typical database is an organized collection of related information stored as “records” having “fields” of information. As an example, a database of employees may have a record for each employee where each record contains fields designating specifics about the employee, such as name, home address, salary, and the like.
Between the actual physical database itself (i.e., the data actually stored on a storage device) and the users of the system, a database management system or DBMS is typically provided as a software cushion or layer. In essence, the DBMS shields the database user from knowing or even caring about the underlying hardware-level details. Typically, all requests from users for access to the data are processed by the DBMS. For example, information may be added or removed from data files, information retrieved from or updated in such files, and so forth, all without user knowledge of the underlying system implementation. In this manner, the DBMS provides users with a conceptual view of the database that is removed from the hardware level. The general construction and operation of database management systems is well known in the art. See e.g., Date, C., “An Introduction to Database Systems, Seventh Edition”, Part I (especially Chapters 1-4), Addison Wesley, 2000.
In any networked system, whether database or otherwise, unique identifiers are needed for various purposes. In modern computing systems, for instance, unique identifiers are often associated with system generated objects to clearly identify an object to the system and distinguish any one object from others in the system. Examples include users, groups of users, files, and hardware components (e.g., printers), all of which have a unique identifier assigned. The generation and maintenance of unique identifiers therefore serves a critical role in data processing environments.
In database systems, unique identifiers are needed when new objects are created. For instance, one typical use is for assigning unique identifiers for rows in a table, that is “row IDs” (popularly known as ROWIDs or RIDs) to uniquely identify a particular row. Particularly challenging is the allocation and management of unique identifiers for use in distributed systems. In a distributed system, all the computers in the network need unique identifiers for doing their computation; objects processed by those computers may themselves need to be uniquely identified across the multiple computers that comprise the distributed system. Thus, there is a need for allocating and managing identifiers that are unique across the entire distributed system.
One approach to the problem is described in U.S. Pat. No. 6,457,053. The approach is based on a master-slave relationship as follows. A system for multi-master unique identifier allocation includes a server for allocating pools of identifiers to requesting servers and at least one server for requesting pools of identifiers and allocating individual identifiers as necessary. A single master server allocates “pools” of unique identifiers to network servers upon request. The network servers, in turn, allocate unique identifiers from their pool as necessary when the network server generates new system objects. When a network server's pool of unique identifiers is nearly depleted, the network server requests an additional pool of identifiers from the master server.
However, as the approach is based on a master-slave relationship, it is not fully distributed (i.e., it requires centralized management). This may lead to problems and limitations, including inefficient messaging and inferior scalability. As one example, the reliance on centralized management has limitations and inefficiencies in handling the addition and deletion of server nodes of the distributed system during ongoing operations, particularly in the case of failure (e.g., crash) of one or more of the server nodes. For instance, if the master server fails or is shut down, another server must take over the role of master, including obtaining the information necessary to serve in the master role. Also, in the event that one of the “slave” nodes (i.e., a network server other than the master) fails or is shut down, unique identifiers assigned to such node may be lost (i.e., no longer available) for use by the other servers. In view of limitations and inefficiencies such as these, a better solution is sought. In particular, what is needed is a system incorporating a methodology of assigning these unique identifiers in a manner which is not centralized and may therefore fully participate in all of the features and benefits of distributed environments, including improved scalability. Ideally, the solution should gracefully and efficiently handle the addition and removal of networked server nodes from the cluster, including those resulting from failure of one or more of the nodes. The present invention fulfills this and other needs.